<template>
	<view class="goods-cards">
		<!-- 商品卡片 -->
		<view class="card-item" v-for="(item,index) in activityBoxList" :key="index">
			<!-- 卡片左侧 -->
			<view class="card-lef">
				<image class="card-img" :src="item.image" mode="aspectFill" />
			</view>
			<!-- 卡片右侧 -->
			<view class="card-rig">
				<view class="good-name">
					{{item.boxName}}
				</view>
				<!-- 盲盒概率 -->
				<view class="good-chance">
					获得概率:{{item.chance}}%
				</view>
				<view class="good-details">
					<view class="goodstatus">
						未入团
					</view>
					<view class="joincoupon">
						入场券：<span class="couponprice">￥{{item.price}}</span>
					</view>
				</view>
			</view>
			<view class="join">
				<view class="joinnum">
					已参与2人，还差<span class="joinnums"> {{joinnum}}</span>人爆团成功
				</view>
				<button class="joinbtn">立即入团</button>
			</view>
			<view class="underline">
				<hr>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				joinnum: 3,
				activityBoxList: [{
					image: this.imagesUrl('pinkdoll.png'),
					boxName: "盲盒名称盲盒名称盲盒名称盲盒名称盲盒名称盲盒名称",
					chance: 20,
					price: 100,
					boxStatus: 1
				}, {
					image: this.imagesUrl('bluecar.png'),
					boxName: "盲盒名称盲盒名称盲盒名称盲盒名称盲盒名称盲盒名称",
					chance: 20,
					price: 100,
					boxStatus: 1
				}, {
					image: this.imagesUrl('pinkdoll.png'),
					boxName: "盲盒名称盲盒名称盲盒名称盲盒名称盲盒名称盲盒名称",
					chance: 20,
					price: 100,
					boxStatus: 1
				}, {
					image: this.imagesUrl('bluecar.png'),
					boxName: "盲盒名称盲盒名称盲盒名称盲盒名称盲盒名称盲盒名称",
					chance: 20,
					price: 100,
					boxStatus: 1
				}, {
					image: this.imagesUrl('pinkdoll.png'),
					boxName: "盲盒名称盲盒名称盲盒名称盲盒名称盲盒名称盲盒名称",
					chance: 20,
					price: 100,
					boxStatus: 1
				}]
			}
		}
	}
</script>

<style lang="scss" scoped>
	.goods-cards {
		.card-item {
			margin: 40rpx auto 96rpx;
			color: white;
			width: 690rpx;
			height: 256rpx;
			background-color: #0a0a0a;
			display: flex;
			justify-content: left;
			align-items: center;
			position: relative;

			.card-lef {
				width: 180rpx;
				height: 180rpx;
				overflow: hidden;

				position: absolute;
				top: 0;

				.card-img {
					width: 100%;
					height: 100%;
				}
			}

			.card-rig {
				width: 480rpx;
				height: 180rpx;
				display: flex;
				flex-direction: column;
				position: absolute;
				right: 0;
				top: 0;

				.good-name {
					height: 48rpx;
					width: 480rpx;
					font-size: 28rpx;
					line-height: 48rpx;
					margin-bottom: 12rpx;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
					position: absolute;
					right: 0;
				}

				.good-chance {
					line-height: 40rpx;
					font-size: 24rpx;
					margin-top: 88rpx;
					opacity: 0.8;
					height: 40rpx;
					position: relative;

				}

				.good-details {
					margin-top: 16rpx;
					display: flex;
					justify-content: space-between;
					align-item: center;
					font-size: 20rpx;
					text-align: right;
					line-height: 20rpx;

					.goodstatus {
						text-align: center;
						width: 84rpx;
						font-size: 28rpx;
						color: #ff7803;
					}

					.couponprice {
						color: #ff7803;
						font-size: 36rpx;
					}


				}
			}

			.join {
				width: 690rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				position: absolute;
				bottom: 0rpx;

				.joinnum {
					position: absolute;

					height: 28rpx;
					left: 0rpx;
					bottom: 18rpx;
					font-size: 28rpx;

					.joinnums {
						color: #ff7803;
					}
				}

				.joinbtn {
					width: 200rpx;
					height: 64rpx;
					font-size: 28rpx;
					position: absolute;
					right: 0rpx;
					bottom: 0rpx;
					color: white;
					border-radius: 32rpx;
					background-color: #ff7803;
					text-align: center;
					line-height: 64rpx;
				}
			}

			.underline {
				position: absolute;
				bottom: -48rpx;
				color: #fff;
				opacity: 0.1;
				width: 100%;
			}
		}
	}
</style>